//
//  CLDataBaseController.h
//  安好
//
//  Created by qinlongqing on 14-8-29.
//  Copyright (c) 2014年 冯凯. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "FMDatabase.h"
#import "FMDatabaseAdditions.h"
#import "AppConfig.h"
#import "SecretaryModel.h"
#import "SubscibeModel.h"
#import "NoticeData.h"

@interface CLDataBaseController : NSObject


+ (CLDataBaseController *)instance;

//- (void)createDataBaseWithName:(NSString *)dataBaseName;

//- (void)createTableWithSQL:(NSString *)createTableSQL;

//- (void)deleteTableWithTableName:(NSString *)tableName;

- (void)insertTableWithTestType:(TestType)testType andDict:(NSMutableDictionary *)dict;

- (NSArray *)selectAllWithTestType:(TestType)testType;


//指定医生相关
- (void)insertSpecifyDoctorWithDict:(NSDictionary *)dict;

- (NSArray *)selectAllSpecifyDoctor;

- (BOOL)deleteSpecifyDoctorWithUID:(NSString *)doctorUID;


//订阅相关
- (void)insertTheNewestSubscibeNewsMessageWithArray:(NSArray *)newestSubscibeMessageArray;

- (void)updataSecretaryNewsMessageToReaded;

- (BOOL)isHaveNoReadedSubscibeNewsMessage;

- (SubscibeModel *)getTheNewestSecretaryNewsMessage;
//订阅内列表项存储
- (void)insertReadedSubscibeWithNid:(NSString *)nid;

- (BOOL)getIsReadedSubscibeWithNid:(NSString *)nid;


//安好秘书相关
- (void)initSecretarySystemMessageForFirstResignOrLogin;

- (void)insertSecretarySystemMessageWithModel:(SecretaryModel *)systemMessageModel;

- (NSArray *)selectAllSecretarySystemMessage;

- (BOOL)isHaveNoReadedSystemMessage;

- (void)updataSecretarySystemMessageToReaded;

- (SecretaryModel *)getTheNewestSecretarySystemMessage;

//notice消息相关
- (void)insertSecretaryNoticeMessageWithArray:(NSArray *)noticeMessageArray;

- (NSArray *)selectSecretaryNoticeMessage;

- (NSArray *)selectAllNoReadedSecretaryNoticeMessage;

- (void)updataSecretaryNoticeMessageToReaded;

- (NoticeData *)getTheNewestSecretaryNoticeMessage;

//上传记步数据相关
- (void)insertStepCountUploadForDay:(NSString *)dayString andDayAllSteps:(NSUInteger)allSteps;

- (void)updataStepCountUploadForDay:(NSString *)dayString andDayAllSteps:(NSUInteger)allSteps;

- (NSString *)selectToGetUserDefaultStoredDay;

- (NSUInteger)selectToGetUserDefaultStoredAllStepsForDay;

@end
